package co.fitstart.entity.courseware.fitnessgroup;

import com.demo2do.core.utils.Alias;

/**
 * 
 * @author mohanlan
 *
 */
@Alias("roundwareStatus")
public enum RoundwareStatus {
    
    GROUPED("grouped", "已分组"),
	
	READY("ready", "编辑中"),
	
	FINISH("finish", "已完成");
	
	private String alias;
	
	private String description;
	
	private RoundwareStatus(String alias, String description) {
		this.alias = alias;
		this.description = description;
	}
	
	/**
	 * @param alias
	 * @return
	 */
	public static RoundwareStatus aliasOf(String alias) {
	    for (RoundwareStatus roundwareStatus : RoundwareStatus.values()) {
            if (roundwareStatus.getAlias().equals(alias)) {
                return roundwareStatus;
            }
        }
	    return null;
	}
	
	/**
	 * 
	 * @return
	 */
	public boolean isGrouped() {
	    return this.equals(GROUPED);
	}
	
	/**
	 * 
	 * @return
	 */
	public boolean isReady() {
		return this.equals(RoundwareStatus.READY);
	}
	
	public boolean isFinish() {
		return this.equals(RoundwareStatus.FINISH);
	}
	
	/**
	 * @return the alias
	 */
	public String getAlias() {
		return alias;
	}
	
	/**
	 * @return the description
	 */
	public String getDescription() {
		return description;
	}
	
}
